/* * * * M A P V I S I O N   L I C E N S E  *****************************************************************
 *
 * This MapVision software is © Filip Zavadil 2013. It is licensed under the LGPL license.
 * This MapVision software dynamically links to unmodified Qt5 Library.
 *
 * The Qt5 Library is © 2013 Qt® and/or its subsidiary(-ies), and is licensed under the
 * GNU Lesser General Public License version 2.1 with Qt® LGPL exception version 1.1.
 * Qt5 library is free software; you can redistribute it and/or modify it under the terms of the
 * GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
 * Qt5 library is provided “AS IS”, without WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
 * IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 *
 * As an additional permission to the GNU Lesser General Public License version 2.1, the object
 * code form of a “work that uses the Library” may incorporate material from a header file that is
 * part of the Library. You may distribute such object code under terms of your choice,
 * provided that: (i) the header files of the Library have not been modified; and (ii)
 * the incorporated material is limited to numerical parameters, data structure layouts, accessors,
 * macros, inline functions and templates; and (iii) you comply with the terms of Section 6 of the
 * GNU Lesser General Public License version 2.1.
 *
 * Moreover, you may apply this exception to a modified version of the Library, provided that such
 * modification does not involve copying material from the Library into the modified Library’s header
 * files unless such material is limited to (i) numerical parameters; (ii) data structure layouts;
 * (iii) accessors; and (iv) small macros, templates and inline functions of five lines or less in length.
 *
 * Furthermore, you are not required to apply this additional permission to a modified version of the Library.
 *
 * You should have received a copy of the GNU Lesser General Public License along with this package;
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

 * The source code for Qt 5.X SDK is available from Qt Project here:
 * http://download.qt-project.org/official_releases/qtcreator/2.7/2.7.0/qt-creator-2.7.0-src.zip.
 *
 * ****************************** M A P V I S I O N    S O F T W A R E  ************************************
 *
 * Author:       Filip Zavadil
 * Description:  Software for displaying and exporting map tiles.
 * The sources and executables of MapVision software are available:
 *    - from project hosting on CodePlex.com :   http://mapvision.codeplex.com
 *    - from GIT repositories on Gitorious.org:  https://gitorious.org/mapvision
 * Visit MapVision fanpage on Facebook.com:      https://www.facebook.com/pages/Mapvision/631827753513935
 *
 * *********************************************************************************************************
*/

#ifndef MAPVISION_H
#define MAPVISION_H

#include <QMainWindow>
#include <QSettings>
#include <QListWidget>

#include "export.h"
#include "mapdocumet.h"
#include "about.h"

#include "layer.h"
#include "layersqlite.h"
#include "layertilesonline.h"

#include "dockwidgetaddmapfeatures.h"
#include "dockwidgetzoomto.h"
#include "dockwidgetselectioninfo.h"
#include "dockwidgeteffects.h"
#include "dockwidgettext.h"
#include "dockwidgetcoorsinfo.h"


/*
 * osGEO tiling: http://wiki.osgeo.org/wiki/Category:Tiling
 * url server format from http://www.gdal.org/frmt_wms.html
 * ArcGis: http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/${z}/${y}/${x}
 * to study: http://www.worldwindcentral.com/wiki/TileService
 *           http://onearth.jpl.nasa.gov/tiled.html
 *           http://wiki.osgeo.org/wiki/WMS_Tiling_Client_Recommendation
 *
 *            http://blog.svg-map.com/2010/11/1-abstract-this-specification-defines-the-features-and-syntax-for-tiling-and-layering-module-for-svg-12-tiny-this-specific.html
 *
 *            http://www.opengeospatial.org/standards/wmts
 */

namespace Ui {
class MapVision;
}

class MapVision : public QMainWindow
{
    Q_OBJECT

public:
    explicit MapVision(QWidget *parent = 0);
    ~MapVision();
    
private:
    Ui::MapVision *ui;

    QSettings settings;
    QList<Layer*> layers;

    Export * exporting;
    MapDocumet * document;
    QMovie *movie;


protected:
    void keyPressEvent(QKeyEvent *);
    void mouseReleaseEvent(QMouseEvent *);

private slots:
    void zoomHasChanged(int);
    void viewScaleHasChanged(int);
    void mouseOn(QString);

    void consoleSave();
    void consoleClear();

    void mapUpdated(QPointF,int,int);
    void panEnabledHasChanged(bool);

    void on_spinBoxView_editingFinished();
    void on_actionPreferences_triggered();
    void on_checkBoxRender_toggled(bool checked);
    void on_action100_triggered();
    void on_action150_triggered();
    void on_action200_triggered();
    void on_action10_triggered();
    void on_action25_triggered();
    void on_action75_triggered();
    void on_action50_triggered();
    void on_spinBoxZoom_editingFinished();

    void on_actionAbout_triggered();
    void on_actionTEST_triggered();
    void on_actionAs_image_triggered();
    void on_actionSelect_by_coordinates_triggered();
    void on_actionInfo_triggered();
    void on_actionLocal_Tiles_triggered();
    void on_actionOnline_Tiles_triggered();
    void on_actionSQLite_databes_triggered();
    void on_action_Open_triggered();
    void on_actionSave_triggered();
    void on_actionSave_As_triggered();

    void on_actionHandPan_toggled(bool arg1);
    void on_actionMake_Selection_toggled(bool arg1);
    void on_actionMousePointer_toggled(bool arg1);
    void on_actionZoomPlus_triggered();
    void on_actionZoomMinus_triggered();

    void on_actionPointer_toggled(bool arg1);
    void on_actionViewMinus_triggered();
    void on_actionViewPlus_triggered();
    void on_actionRefresh_triggered();
    void on_actionTEST_2_triggered();
    void on_actionWelcome_screen_triggered();

    void on_actionIMG_triggered();

    void on_actionQuit_triggered();

public slots:
    void printMessage(QString);
};

#endif // MAPVISION_H
